package net.lab1024.sa.admin.module.business.erp.prp.controller;

import net.lab1024.sa.admin.module.business.erp.prp.domain.form.BipordbAddForm;
import net.lab1024.sa.admin.module.business.erp.prp.domain.form.BipordbQueryForm;
import net.lab1024.sa.admin.module.business.erp.prp.domain.form.BipordbUpdateForm;
import net.lab1024.sa.admin.module.business.erp.prp.domain.vo.BipordbVO;
import net.lab1024.sa.admin.module.business.erp.prp.service.BipordbService;
import net.lab1024.sa.base.common.domain.ValidateList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.common.domain.PageResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * BIP运算单行 Controller
 *
 * @Author AKITA
 * @Date 2025-08-13 23:51:27
 * @Copyright AKITA
 */

@RestController
@Tag(name = "BIP运算单行")
public class BipordbController {

    @Resource
    private BipordbService bipordbService;

    @Operation(summary = "分页查询 @author AKITA")
    @PostMapping("/bipordb/queryPage")

    public ResponseDTO<PageResult<BipordbVO>> queryPage(@RequestBody @Valid BipordbQueryForm queryForm) {
        return ResponseDTO.ok(bipordbService.queryPage(queryForm));
    }

    @Operation(summary = "添加 @author AKITA")
    @PostMapping("/bipordb/add")

    public ResponseDTO<String> add(@RequestBody @Valid BipordbAddForm addForm) {
        return bipordbService.add(addForm);
    }

    @Operation(summary = "更新 @author AKITA")
    @PostMapping("/bipordb/update")

    public ResponseDTO<String> update(@RequestBody @Valid BipordbUpdateForm updateForm) {
        return bipordbService.update(updateForm);
    }

    @Operation(summary = "批量删除 @author AKITA")
    @PostMapping("/bipordb/batchDelete")

    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
        return bipordbService.batchDelete(idList);
    }

    @Operation(summary = "单个删除 @author AKITA")
    @GetMapping("/bipordb/delete/{id}")

    public ResponseDTO<String> batchDelete(@PathVariable Long id) {
        return bipordbService.delete(id);
    }





    @Operation(summary = "添加 @author AKITA")
    @PostMapping("/bipordb/deleteByLineNum")

    public ResponseDTO<String> deleteByLineNum(@RequestBody @Valid BipordbAddForm addForm) {
        return bipordbService.deleteByLineNum(addForm);
    }
}
